home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / ien / ien-176 < prev    next >
Text File  |  1988-12-01  |  35KB  |  883 lines

  1. IEN 176
  2.  
  3.  
  4.                                                 Dave Lyons
  5.                                                 Digital     Equipment
  6.                                                 Corporation
  7.                                                 March, 1981
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                The DECSYSTEM-20 TCP/IP user interface
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                 This document describes the USER / TCP
  24.                 interface    for    the   DECSYSTEM-20
  25.                 operating system.   It  also  includes
  26.                 information  on an interface which may
  27.                 be     used     for     developmenting
  28.                 experimental higher level protocols.
  29.  
  30.                                                                
  31.  
  32.  
  33.      The information in this document is subject  to  change  without
  34.      notice  and  should  not be construed as a commitment by Digital
  35.      Equipment Corporation.  Digital Equipment Corporation assumes no
  36.      responsibility for any errors that may appear in this document.
  37.  
  38.      The software described in this document  is  furnished  under  a
  39.      license  and  may  be used or copied only in accordance with the
  40.      terms of such license.
  41.  
  42.      Digital Equipment Corporation assumes no responsbility  for  the
  43.      use  or  reliability  of  its  software on equipment that is not
  44.      supplied by DIGITAL.
  45.  
  46.  
  47.         Copyright  (C)  1981 by Digital Equipment Corporation
  48.  
  49.  
  50.      The following are trademarks of Digital Equipment Corporation:
  51.  
  52.         DIGITAL            DECsystem-10         MASSBUS
  53.         DEC                DECtape              OMNIBUS
  54.         PDP                DIBOL                OS/8
  55.         DECUS              EDUSYSTEM            PHA
  56.         UNIBUS             FLIP CHIP            RSTS
  57.         COMPUTER LABS      FOCAL                RSX
  58.         COMTEX             INDAC                TYPESET-8
  59.         DDT                LAB-8                TYPESET-10
  60.         DECCOM             DECSYSTEM-20         TYPESET-11
  61.  
  62.                                                                Page 1
  63.  
  64.  
  65.      This document describes the formats and relations  of  the  USER
  66.      interface  and  the  Department  of Defense Transmission Control
  67.      Protocol and Internet Protocol.
  68.  
  69.      This document is divided into four sections.   The  first  deals
  70.      with  the "Raw packet" interface to the Internet Protocol.  This
  71.      interface may be used by programmer to  implement  higher  level
  72.      protocols  such as the Transmission Control Protocol, a datagram
  73.      service, or a specialized protocol such as  voice  transmission.
  74.      This  interface  is  not  intended to be used as a user datagram
  75.      service.  It is included to allow protocols other than TCP to be
  76.      implemented and used.
  77.  
  78.      The second section is concerned with the TCP  /  USER  interface
  79.      itself.   It  describes  the  various  attributes  that  may  be
  80.      associated with a connection, and the  formats  of  the  monitor
  81.      calls  to set and read these attributes.  It is assumed that the
  82.      reader is familiar with  the  DECSYSTEM-20  user  interface  for
  83.      files.
  84.  
  85.      The third  section  explains  the  interrelations  of  the  user
  86.      interface  and  certain network events (such as receiving data).
  87.      This section also covers differences between  "local"  I/O,  and
  88.      "network" I/O.
  89.  
  90.      The  fourth  section   covers   the   retransmission   algorithm
  91.      exponential smoothing function.
  92.  
  93.                                                                Page 2
  94.  
  95.  
  96. Section 1.  The INTERNET interface.
  97.  
  98. IPOPR% JSYS (754) - I P operations
  99.  
  100. This  section  covers  the  IPOPR  JSYS  and  its  functions.   These
  101. functions  can be used to send and receive special messages directly,
  102. or to set various system parameters related to the IP network layer.
  103.  
  104. Restrictions:   Some functions may require WHEEL or OPERATOR.  In 
  105.                 addition, some other functions may require 
  106.                 NETWORK-WIZARD.
  107.  
  108. Accepts in AC1: JFN, Special Queue number, or other designator.
  109.            AC2: Function code and optional flags.
  110.            AC3: Argument or pointer to argument block.
  111.  
  112. Returns:   +1   Always
  113.  
  114.  
  115. A RESET%  JSYS  will  release  all  special  queues  that  have  been
  116. assigned.
  117.  
  118.  
  119.  
  120. Code    Symbol          Meaning
  121.  
  122. 0       .IPASQ  Assign special queue for IP packets.   This  function
  123.                 requires  NETWORK-WIZARD.   AC3  points to a block of
  124.                 the form:
  125.  
  126.                 Word 0: .IPPPV  ! 32 bits internet protocol ! 4 bits !
  127.                                 ! number                    !        !
  128.                 Word 1: .IPFHV  ! 32 bits foreign host      ! 4 bits !
  129.                                 ! number                    !        !
  130.                 Word 2: .IPLHV  ! 32 bits local host number ! 4 bits !
  131.                 Word 3: .IPPTV  ! 16 bits local port,       ! 4 bits !
  132.                                 !  16 bits distant port     !        !
  133.                 Word 4: .IPPPM  ! mask for .IPPPV           ! 4 bits !
  134.                 Word 5: .IPFHM  ! mask for .IPFHV           ! 4 bits !
  135.                 Word 6: .IPLHM  ! mask for .IPLHV           ! 4 bits !
  136.                 Word 7: .IPPTM  ! mask for .IPPTV           ! 4 bits !
  137.  
  138.                 If IP%SPP is  set,  word  3  distant  port  bits  are
  139.                 ignored.
  140.  
  141.                 Other flag bits in AC2 are:
  142.                 IP%RPI = 1B0    ;Raw Packet Interface
  143.                 IP%SPP = 1B1    ;Single Port Protocol
  144.  
  145.                 On a successful return, AC1 contains a Special  queue
  146.                 handle.
  147.  
  148.                                                                Page 3
  149.  
  150.  
  151. 1       .IPRSQ  Release IP special queues.  AC3  contians  the  queue
  152.                 handle or -1 for all assigned queues.
  153.  
  154.  
  155. 2       .IPSSM  Send Special Message.   AC3  points  to  an  argument
  156.                 block of the following form.
  157.  
  158.                 1.  Word 0  of  the  buffer  must  be  a  word  count
  159.                     (including word 0)
  160.  
  161.                 2.  Words 1 thru 5 must be a legal Internet Header
  162.  
  163.                 3.  If IP%SPP was set when the ASNSQ jsys  was  done,
  164.                     word 6 must contain port number(s)
  165.  
  166.                 The monitor will validate the local  host  field  and
  167.                 compute the header checksum.
  168.  
  169.  
  170. 3       .IPRSM  Receive Special Message.   AC3  points  to  a  buffer
  171.                 which receive the data.  The first word of the buffer
  172.                 must contain the length of the buffer  in  the  right
  173.                 half.   After  the  call, the length is stored in the
  174.                 left half.  If the message is too long, a size  error
  175.                 is  given, and the message is truncated to the length
  176.                 of the buffer.
  177.  
  178.  
  179.  
  180. Possible errors:
  181.  
  182. NTWZX1  NETWORK-WIZARD capability required
  183.  
  184. IPOX1   Illegal function code
  185.  
  186. IPOX2   All Special Queues are in use
  187.  
  188. IPOX3   Special Queue allocation conflict
  189.  
  190. IPOX4   Invalid message size
  191.  
  192. IPOX5   Insufficient system resources
  193.  
  194. IPOX6   Invalid header value in this queue
  195.  
  196. IPOX7   Queue handle out of range
  197.  
  198. IPOX8   Queue was not assigned
  199.  
  200. IPOX9   WHEEL, OPERATOR or NETWORK-WIZARD capability required
  201.  
  202.                                                                Page 4
  203.  
  204.  
  205. Section 2.  The USER / TCP interface
  206.  
  207. It is the programmers responsibility to provide  information  to  the
  208. operating   system  about  the  network  connection  required.   This
  209. information is passed to the operating system thru  a  GTJFN  monitor
  210. call.  Although TCP has full duplex data connections, there is a need
  211. for two types  of  connections,  active,  and  passive.   The  active
  212. connection can be thought of as going out and finding someone to talk
  213. with.  This is also refered to as the Caller.  The passive connection
  214. can  be  thought  of  as waiting until someone shows up to talk with.
  215. This is also refered to as a Listener.  The format used  by  the  TCP
  216. network protocol is as follows.
  217.  
  218. TCP:[LOCAL_HOST][-LOCAL_PORT[#]].[FOREIGN_HOST][-FOREIGN_PORT][;A1..]
  219.  
  220.  
  221. The following examples show the various ways that connections may  be
  222. specified.
  223.  
  224.  
  225.      1.  TCP:.RADC-TOPS20-1;CONN:ACTIVE
  226.  
  227.      2.  TCP:1#
  228.  
  229.      3.  TCP:1#.-5000
  230.  
  231.      4.  TCP:1#.1200200002;CONN:PASIVE
  232.  
  233.      5.  TCP:4500000254.1200200117-3;CONN:ACT
  234.  
  235.      6.  TCP:4500000254-177#.1200200117-123;CON:A;BUF:128;PER:0
  236.          ;TI:60;TY:2;SEC:2;COM:2
  237.  
  238.  
  239. In case  1,  the  local  information  is  not  present  and  will  be
  240. defaulted.  Port numbers are controlled as follows:
  241.  
  242.         If the number is in the range of 0 to 377 (octal), it must be
  243.         followed  by a "#", and the user must have WHEEL, OPERATOR or
  244.         NETWORK-WIZARD.  The "#" is redundant,  but  is  included  to
  245.         prevent  mistakes.   This  range  of  numbers is reserved for
  246.         system servers.
  247.  
  248.         The numbers between 400 and 77777 are reserved for users  and
  249.         are not controlled by the system.
  250.  
  251.         Numbers in the range of 100000 to 177777 are reserved by  the
  252.         system, and assigned on a "need" basis.
  253.  
  254.         Note:  The monitor will assign the numbers in  the  following
  255.         manner.   The  "sign"  bit  of the port number will always be
  256.         set, the next 9 bits will be reserved for the job number, and
  257.         the  last  6  bits  will  the  the  JFN  number  assigned the
  258.  
  259.                                                                Page 5
  260.  
  261.  
  262.         connection.  These assignments are subject to change  without
  263.         notice.
  264.  
  265.  
  266. As example 1 fits into the third case, it will  be  assigned  a  port
  267. number  by  the  system.   The  destination  system  is identified as
  268. "RADC-TOPS20" and the port number is "1".  The  CONNECTION  attribute
  269. is  present  with the ACTIVE option, and this system will attempt the
  270. connection.
  271.  
  272. The name/Internet Number binding is local to only this system.  It is
  273. the  responsibility  of  the  system  administrator  to maintain this
  274. binding.  There are no restrictions on having many names identify the
  275. same  system,  or having the same name on different systems disagree.
  276. The later situation should be avoided, but this is not required.
  277.  
  278.  
  279. The second case shows a passive open on port 1.  The connection  will
  280. be accepted from any host and any port
  281.  
  282.  
  283. The third case shows a passive open on port 1 that will  only  accept
  284. connections from any system with a port number of 5000.
  285.  
  286.  
  287. The fourth case shows a passive open on port 1 for any user  on  node
  288. 1200200002 (SRI-KL).
  289.  
  290.  
  291. The fifth case shows an active connection from host  4500000254  (the
  292. DECnet  side  of  DEC-2136) with a defaulted port number.  The target
  293. side of the connection is the ARPANET side of DEC-2136.
  294.  
  295.  
  296. The sixth example  shows  a  connection  from  DEC-2136  (DECnet)  to
  297. DEC-2136   (ARPANET).    This   connection   includes  the  following
  298. attributes:
  299.  
  300.         ;CON:A  show an active connection
  301.         ;BUF:128        buffer size of 128 bytes
  302.         ;PER:0  persist in opening the connection
  303.         ;TI:60  time the connection out if there is a 60 second
  304.                 failure
  305.         ;TY:2   type of service is Speed vs. Reliability
  306.         ;S:2    security level of 2
  307.         ;COM:2  compartment of 2
  308.  
  309.                                                                Page 6
  310.  
  311.  
  312. The following are valid attributes:
  313.  
  314.  
  315. ;CONNECTION:ACTIVE
  316. ;CONNECTION:PASSIVE  This  attribute  is  used  to  indicate  if  the
  317.         operating  system  should  actively  connect  to  the foreign
  318.         system.  The default is PASSIVE.
  319.  
  320.  
  321. ;BUFFER:n This attribute indicates that record mode I/O with  records
  322.         of  N  bytes  is  to  be used.  N may be in the range of 0 to
  323.         2^16-1.  If not given, unbuffered I/O will be used.
  324.  
  325.  
  326. ;PERSIST:n
  327. ;PERSIST:(n,m) With an argument of 0, attempt to open the  connection
  328.         and  keep  trying until successful.  If n is given, try for n
  329.         seconds, at which  time  an  error  return  is  given  if  no
  330.         connection  has been established.  An attempt is made every m
  331.         seconds, where m is an  estimate  of  the  round  trip  delay
  332.         between  systems  or provided by the user.  If no persistence
  333.         is given, 30 seconds will be used.
  334.  
  335.  
  336. ;TIMEOUT:n The amount of time allowed to pass  while  waiting  for  a
  337.         message  from  the foreign system before an error is given to
  338.         the user.  If not given, a default 30 seconds will  be  used.
  339.         If  the  value of n is 0, no timeout will occur.  N may be in
  340.         the range of 0 to 2^18-1.
  341.  
  342.  
  343. ;TYPE-OF-SERVICE:n The type of service required by the user indicates
  344.         what tradeoffs are to be made in providing data transmission.
  345.         N  may  be  in  the  range  of  0  to  (2^18-1).    The   TCP
  346.         implementation will only use the low order 8 bits.
  347.  
  348.  
  349. ;SECURITY:n The security level of the connection may range from 0  to
  350.         3.  If not specified, a value of 0 will be used.
  351.  
  352.  
  353. ;COMPARTMENT:n The compartment level of a connection is specified  as
  354.         a  code  provided  for the user by the Defense Communications
  355.         Agency.  N may be in the range of 0 to 255.
  356.  
  357.  
  358. Note that these last two fields are not used in TCP  itself,  but  in
  359. lower layers of the protocols.  The are provided for at this level to
  360. allow the user control over these fields.  Also, the use of either of
  361. these  two fields will invoke a request to the Access Control Job, or
  362. will fail if the Access Control is not enabled for  these  functions.
  363. The  TYPE-OF-SERVICE  field  will  also  invoke  a call to the Access
  364. Control Job, but will be allowed if Access Control is not enabled for
  365.  
  366.                                                                Page 7
  367.  
  368.  
  369. this function.
  370.  
  371.                                                                Page 8
  372.  
  373.  
  374. TCOPR% JSYS (755)
  375.  
  376. The following are the TCOPR functions related to  the  TCP:   device.
  377. These  functions  are like the MTOPR JSYS, but are only used with the
  378. TCP device.
  379.  
  380. ACCEPTS AC1:    JFN of device
  381.         AC2:    function code (see below)
  382.         AC3:    function argument or address of argument block.
  383.                 See each function for details.
  384.  
  385. RETURNS +1      always
  386.  
  387.  
  388.  
  389. Code    Symbol          Meaning
  390.  
  391. 0       .TCRCS          read connection  status.   AC3  points  to  a
  392.                         block which at least .TCRCL words long.
  393.  
  394.                 .TCLEN  0       Length of block
  395.  
  396.                 .TCTFP  1       Foreign port
  397.                         TC%TFP          16 bits, right justified
  398.  
  399.                 .TCTFH  2       Foreign host
  400.                         TC%TFH          32 bits, right justified
  401.  
  402.                 .TCTLP  3       Local port
  403.                         TC%TLP          16 bits, right justified
  404.  
  405.                 .TCTLH  4       Local host
  406.                         TC%TLH          32 bits, right justified
  407.  
  408.                 .TCTRW  5       Receive window
  409.                         TC%TRW 16 bits, right justified
  410.  
  411.                 .TCTSW  6       Send window
  412.                         TC%TSW          16 bits, right justified
  413.  
  414.                 .TCTCS  7       Connection state
  415.                         TC%TCS          4 bits, right justified
  416.  
  417.                                 .TCPCL  closed
  418.                                 .TCPLI  listen
  419.                                 .TCPSS  syn sent
  420.                                 .TCPSR  syn received
  421.                                 .TCPES  established
  422.                                 .TCPF1  fin wait 1
  423.                                 .TCPF2  fin wait 2
  424.                                 .TCPTW  time wait
  425.                                 .TCPCW  close wait
  426.                                 .TCPCG  closing
  427.  
  428.                                                               Page 9
  429.  
  430.  
  431.                 .TCTBW  10      Buffers waiting ack
  432.                         TC%TBW          8 bits, right justified
  433.  
  434.                 .TCTBP  11      Buffers pending receipt
  435.                         TC%TBP          8 bits, right justified
  436.  
  437.                 .TCTBS  12      Buffer size
  438.                         TC%TBS          16 bits, right justified
  439.  
  440.                 .TCTTS  13      Type-of-service and security fields
  441.                         TC%TTS          18 bits, 1st 18 bit byte
  442.                         TC%TSF          2 bits, 3rd 9 bit byte
  443.                         TC%TCF          8 bits, 4th 9 bit byte
  444.  
  445.                         The bits used in the TCP  implementation  are
  446.                         as follows.
  447.  
  448.                                 .TCTPR 3 bits   Precedence
  449.                                 .TCTST  1 bit   Stream / Datagram
  450.                                 .TCTRE  2 bits Reliability
  451.                                 .TCTSR  1 bit Speed / Reliability
  452.                                 .TCTSP  1 bit Speed
  453.  
  454.                 .TCTTT  14      Transmission timeout
  455.                         TC%TTT          9 bits, right justified
  456.  
  457.                 .TCTUD  15      Urgent  data   information   (to   be
  458.                         defined)
  459.  
  460.                 .TCTRA  16      Retransmission parameters - Alpha
  461.                         TC%TRA Alpha, a floating point number.
  462.  
  463.                 .TCTRB  17      Retransmission  parameters   -   Beta
  464.                         TC%TRB  Beta, a floating point number.
  465.  
  466.                         See the section on message retransmission for
  467.                         a  description  of  these fields, their uses,
  468.                         and limitations.
  469.  
  470.                 .TCTPI  20      PSI channel assignment.  See function
  471.                         .TCSPC for a definition of this field.
  472.  
  473.  
  474. 1       .TCSUD          Send urgent data.  AC3 points to a  block  of
  475.                         the form
  476.  
  477.                 0       Pointer to data
  478.                 1       Count of bytes or 0
  479.                 2       Byte to terminate output on
  480.  
  481.                         (note that these are the same as AC2 - AC4 of
  482.                          the SOUT and SOUTR JSYS's)
  483.  
  484.                                                               Page 10
  485.  
  486.  
  487.                          Setting TC%FEL in  AC3  will  force  End  Of
  488.                          Letter to be set.
  489.  
  490.  
  491. 2       .TCSBS          Set buffer size.  AC3 contains  a  number  in
  492.                         the  range  of  0  to  2^16-1.   A value of 0
  493.                         indicates non-buffered mode.
  494.  
  495.  
  496. 3       .TCSPA          Set passive/active flag.  TC%APF  is  set  in
  497.                         AC3  to  indicate  an  active connection, and
  498.                         cleared to indicate a passive connection.
  499.  
  500.  
  501. 4       .TCSPP          Set persistence parameters.  AC3 is the  time
  502.                         to wait for connections.
  503.  
  504.                         If AC3 is 0, do not timeout the connection.
  505.  
  506.                         If AC3 contains 0,,n an  attempt  to  connect
  507.                         will    be    made   for   n   seconds   with
  508.                         retransmission time estimated by the system
  509.  
  510.                         If AC3 contains m,,n an  attempt  to  connect
  511.                         will    be    made   for   n   seconds   with
  512.                         retransmission every m seconds.   M  must  be
  513.                         less than n.
  514.  
  515.  
  516. 5       .TCSTP          Set timeout  parameters.   AC3  contains  the
  517.                         time  to  wait  before  a timeout.  The value
  518.                         given must be in the range of 0 to 2^18-1.
  519.  
  520.                         If AC3 contains a 0, no timeout will occur.
  521.  
  522.  
  523. 6       .TCSRP          Set retransmission parameters.  AC3 points to
  524.                         an  argument  block  which is two words long.
  525.                         The  first  word  contain  a  floating  point
  526.                         number,   Alpha,   and  the  second  contains
  527.                         another floating point number  Beta.   For  a
  528.                         description  of  these  two  fields  see  the
  529.                         section on message retransmission.
  530.  
  531.  
  532. 7       .TCSTS          Set Type-of-service.  AC3 contains  the  type
  533.                         of service desired.  The value must be in the
  534.                         range of 0 to 2^18-1.
  535.  
  536. 10      .TCSSC          Set security  and  compartment  levels.   AC3
  537.                         contains   the   security   level   and   the
  538.                         compartment    levels     in     the     form
  539.                         (security),,(compartment)
  540.  
  541.                                                               Page 11
  542.  
  543.  
  544.                         Security may be in  the  range  of  0  to  3.
  545.                         Compartment  may  be  in  the  range  of 0 to
  546.                         2^8-1.
  547.  
  548.  
  549. 11      .TCSPC          Set PSI channels.  AC3  contains  six  6  bit
  550.                         fields as follows
  551.  
  552.                 TC%TPU  1st byte, Urgent data channel
  553.                 TC%TRI  2nd byte, Read data channel
  554.                 TC%TSI  3rd byte, Send data channel
  555.                 TC%TER  4th byte, Error channel
  556.                 TC%TSC  5th byte, State change
  557.                 TC%TXX  6th byte, unused, must be 77 (octal)
  558.  
  559.                         To indicate that no interrupt is desired  for
  560.                         a   given  function,  specify  the  value  77
  561.                         (octal) for the channel.
  562.  
  563. 12      .TCRTW          Read  a  single  entry  from  the  TCB.   AC3
  564.                         contains the word of the TCB that is desired.
  565.                         On return, AC3 will contain the value of  the
  566.                         word in question.
  567.  
  568.                         For a list of the words that may be returned,
  569.                         see the function .TCRCS.
  570.  
  571. 13      .TCSIL          Set the interrupt  level  for  buffers.   AC3
  572.                         contains  a number between 0 and 1024 in each
  573.                         half.  The left half sets the number of bytes
  574.                         received before an interrupt will occur.  The
  575.                         right half sets the  number  of  bytes  which
  576.                         must be available in the output buffer before
  577.                         an interrupt will occur.  In  both  cases,  a
  578.                         value  of  0  (the  default)  will be treated
  579.                         exactly like a value of 1.
  580.  
  581. 14      .TCSSR          Set the route to be used in  transmission  of
  582.                         the  message.   AC3  points  to  an  argument
  583.                         block.  The first word of that block  is  the
  584.                         total   length   of  the  block.   Each  word
  585.                         thereafter is the  Internet  Address  of  the
  586.                         next node to route to, right justified.
  587.  
  588. 15      .TCRLB          Read lower  bound  for  retransmission.   The
  589.                         number  of  seconds  is  returned in AC3 as a
  590.                         floating point number.
  591.  
  592. 16      .TCSLB          Set  lower  bound  for  retransmission.   The
  593.                         number  of  seconds  will  be  in  AC3  as  a
  594.                         floating  point  number.    Requires   WHEEL,
  595.                         OPERATOR  or NETWORK-WIZARD.  The number must
  596.                         be larger than 0 and less  than  the  current
  597.  
  598.                                                               Page 12
  599.  
  600.  
  601.                         upper bound.
  602.  
  603. 17      .TCRUB          Read upper  bound  for  retransmission.   The
  604.                         number  of  seconds  is  returned in AC3 as a
  605.                         floating point number.
  606.  
  607. 20      .TCSUB          Set  upper  bound  for  retransmission.   The
  608.                         number  of  seconds  will  be  in  AC3  as  a
  609.                         floating  point  number.    Requires   WHEEL,
  610.                         OPERATOR  or NETWORK-WIZARD.  The number must
  611.                         be larger than the current  lower  bound  and
  612.                         less than 250.
  613.  
  614.  
  615. The following functions do not require a JFN  in  AC1,  as  they  are
  616. system wide.  AC1 must contain a 0.
  617.  
  618. 100     .TCRDLB         Read default lower bound for  retransmission.
  619.                         The number of seconds is returned in AC3 as a
  620.                         floating point number.
  621.  
  622. 101     .TCSDLB         Set default lower bound  for  retransmission.
  623.                         The  number  of  seconds  will be in AC3 as a
  624.                         floating  point  number.    Requires   WHEEL,
  625.                         OPERATOR  or NETWORK-WIZARD.  The number must
  626.                         be larger than 0 and less  than  the  current
  627.                         upper bound.
  628.  
  629. 102     .TCRDUB         Read default upper bound for  retransmission.
  630.                         The number of seconds is returned in AC3 as a
  631.                         floating point number.
  632.  
  633. 103     .TCSDUB         Set default upper bound  for  retransmission.
  634.                         The  number  of  seconds  will be in AC3 as a
  635.                         floating  point  number.    Requires   WHEEL,
  636.                         OPERATOR  or NETWORK-WIZARD.  The number must
  637.                         be larger than the current  lower  bound  and
  638.                         less than 250.
  639.  
  640.  
  641.  
  642. Error codes:
  643.  
  644. DESX1   Invalid source/destination designator
  645.  
  646. DESX3   JFN is not assigned
  647.  
  648. DESX4   Invalid use of terminal designator or string pointer
  649.  
  650. DESX9   Invalid operation for this device
  651.  
  652. IOX5    Device or data error
  653.  
  654.                                                               Page 13
  655.  
  656.  
  657. TCOX1   Invalid function
  658.  
  659. TCOX2   input error or not all data read
  660.  
  661. TCOX3   invalid software interrupt channel
  662.  
  663. TCOX4   Field conflict.  Returned if two fields  must  be  specified,
  664.         and there was an error in the relative size of the fields.
  665.  
  666. TCOX5   Illegal function after OPENF call.  The function can only  be
  667.         performed before the OPENF JSYS is executed.
  668.  
  669. TCOX6   WHEEL, OPERATOR, or NETWORK-WIZARD capability required
  670.  
  671.                                                               Page 14
  672.  
  673.  
  674. Section 3.  I/O interrelations.
  675.  
  676. This section describes the relations of various monitor  calls  which
  677. relate to performing I/O for a TCP device.
  678.  
  679. First, the user may execute a TCOPR JSYS to set various fields within
  680. the  transmission  control  block (TCB).  Some of these functions are
  681. allowed only before the OPENF.  These include
  682.  
  683.         .TCSSC  Set security and compartment levels
  684.         .TCSPA  Set passive/active flag (makes  no  sense  after  the
  685.                 OPENF has been done)
  686.         .TCSBS  Set buffer size
  687.         .TCSPP  Set persistence parameters (makes no sense after  the
  688.                 OPENF has been done)
  689.  
  690. If the user has enabled for  PSI  interrupts  on  state  changes,  an
  691. interrupt  will  be  given  the  user every time the state machine is
  692. stepped.
  693.  
  694. If the user has enabled interrupts for URGENT data, an interrupt will
  695. be  given to the user each time the urgent data pointer is increased,
  696. that is, we have been notified of more urgent data than we previously
  697. knew  about.   If  the  user  has not read all of the previous urgent
  698. data, the interrupt will still be sent.
  699.  
  700. If the user has enabled interrupts for errors, a PSI  interrupt  will
  701. be given under the following conditions:
  702.  
  703.      1.  A timeout has  occured  (either  in  communications,  or  in
  704.          opening the channel).
  705.  
  706.      2.  An ABORT or RST (reset) message was received.
  707.  
  708.  
  709. These types of events also step the  state  machine,  and  will  also
  710. cause an interrupt on the state channel.
  711.  
  712. SIN, SINR, BIN, SIBE, DIBE and input interrupts.
  713.  
  714. If the user has enabled for input data interrupts, the  program  will
  715. be  interrupted when the amount of unread user data exceeds the value
  716. provided with the  .TCSIL  function  or  non-zero  if  no  value  was
  717. specified.   At  any  time,  a  SIBE will return the number of unread
  718. bytes available to the  user,  i.e.   those  bytes  which  have  been
  719. acknowledged.  This is not the receive window size.  To determine the
  720. size of the receive window, the program must use a TCOPR  JSYS.   The
  721. actions  of the SINR JSYS are documented in the monitor calls manual,
  722. and the TCP flag "EOL" (end of letter)  will  be  used  to  determine
  723. record blocking.
  724.  
  725. SOUT, SOUTR, BOUT, SOBE, SOBF, DOBE, and output interrupts.
  726.  
  727.                                                               Page 15
  728.  
  729.  
  730. If the user has performed a passive open, and then  executes  a  JSYS
  731. which  will  cause output to occur, the TCB is converted to an active
  732. open, and the user will block until the connection is established and
  733. the data specified by the JSYS is moved into the monitor, or an event
  734. which will cause the user to be notified of an error occurs.
  735.  
  736. If the user has enabled for output data interrupts, the program  will
  737. be  interrupted  when  the output buffer becomes "non-full", that is,
  738. space is available in the output buffer.  If the user has indicated a
  739. "buffer  level"  with  the  .TCSIL  function  of  the TCOPR JSYS, the
  740. interrupt will be signaled when the free space in the buffer  exceeds
  741. the  specified  level.   At  any time, a SOBE or SOBF will return the
  742. number of bytes which are in the output buffer, i.e.  the  number  of
  743. bytes which are have not been acknowledged by the foreign host.  When
  744. a SOUTR is executed, the data message sent to the foreign system will
  745. have  the EOL bit set, and the byte numbering will be adjusted to the
  746. next record boundry.  This  record  size  is  set  with  the  ;BUFFER
  747. attribute to GTJFN, or with the .TCSBS function of the TCOPR JSYS.
  748.  
  749.  
  750. Single Fork I/O.  A short description.
  751.  
  752. Some concern over how to perform I/O to multiple connections  with  a
  753. single  fork have been raised.  The way to do this is fairly straight
  754. forward.  The following description demonstrates how  this  might  be
  755. accomplished.   For  simplicity,  we  will only examine the case of a
  756. single input stream, and  assume  some  critical  background  process
  757. (like  computing pi to 100,000,000 places).  We will also assume that
  758. the program is only willing to be interrupted when 100 or more  bytes
  759. are available.
  760.  
  761.  
  762.      1.  The program opens a connection to the source of the data.
  763.  
  764.      2.  The program enables interrupts for receive  data,  and  sets
  765.          the  interrupt  level  to  100.  This is done with the TCOPR
  766.          functions .TCSPC and .TCSIL.
  767.  
  768.      3.  The program starts computing pi.
  769.  
  770.      4.  At  some  point  in  time,  an  interrupt  occurs,  and  the
  771.          calculation  of  pi  is  interrupted.   At  this  point  the
  772.          programmer knows the there has been at least  100  bytes  of
  773.          data  available  since  the last interrupt.  The program may
  774.          read  any  amount  of  this  data.   Let  us  look  at   the
  775.          implications.
  776.  
  777.          1.  The fact that an interrupt has occured implies that  the
  778.              condition  for the interrupt has been true at least once
  779.              since the last interrupt.  This does not  guaranty  that
  780.              the  condition  is  still true.  The program must assure
  781.              that these conditions still exist within  the  interrupt
  782.              code.  This is true for ALL of TOPS-20.
  783.  
  784.                                                               Page 16
  785.  
  786.  
  787.          2.  In light of number 1, if a program receives an interrupt
  788.              for  data  available, and reads data until less than 100
  789.              bytes remain, that program will receive an interrupt for
  790.              data  when more than 100 bytes are available, regardless
  791.              of when this event occurs.
  792.  
  793.          3.  Assume the program receives an interrupt for  data,  and
  794.              120  bytes  are  available.   The  program then reads 60
  795.              bytes.  While  the  program  is  processing  this  data,
  796.              another  45  bytes  of  data  is  received.  The program
  797.              checks for data, and finds that 105 bytes are available.
  798.              The  program  reads  all the data, and will then dismiss
  799.              the interrupt.  As the conditions in number 1 are  true,
  800.              the  program  will  receive  another  interrupt for data
  801.              being available right away, even though there is no data
  802.              available.   As  number  1  points out, the program must
  803.              assure that the conditions  are  still  true.   In  this
  804.              case,  they  are not, and the program should dismiss the
  805.              interrupt.
  806.  
  807.          4.  If the program receives  an  interrupt,  fails  to  read
  808.              enough  data  to  drive  the  number  of bytes below the
  809.              current alarm level, and  dismisses  the  interrupt,  no
  810.              more  interrupts  will be given for that channel.  There
  811.              can be no transition over the alarm level.
  812.  
  813.  
  814.      5.  The program enters a loop to  read  the  data.   First,  the
  815.          program executes a SIBE JSYS to determine he exact number of
  816.          bytes available.  The program  then  reads  this  data,  and
  817.          processes  it.  The program continues in this loop until the
  818.          SIBE JSYS indicated there is no more data to be read.
  819.  
  820.      6.  The program dismisses the interrupt, and the calculation  of
  821.          pi continues.
  822.  
  823.      7.  The program completes the  calculation  of  pi,  prints  the
  824.          results, closes the TCP connection, and exits.
  825.  
  826.  
  827.  
  828. It is probably easiest to think of interrupts as a "pulse" which will
  829. be queued for a job until that job is willing to receive it (i.e.  at
  830. a lower interrupt level, or not at  interrupt  level  at  all).   The
  831. "pulse"  will remain queued even if the conditions which caused it no
  832. longer true.  Many different interrupts may be queued for a job,  and
  833. they  will be processed in order of occurrence within order of level.
  834. Again, this is true for all of TOPS-20.
  835.  
  836.                                                               Page 17
  837.  
  838.  
  839. Section 4.  Data retransmission
  840.  
  841. This section describes the data retransmission parameters, Alpha  and
  842. Beta.
  843.  
  844. The functions used provide an "elongation factor" or delay  variance,
  845. Alpha, as well as an exponential smoothing function with weighting of
  846. Beta.  Assume the following:
  847.  
  848.     RTT is the delay between the sending of an octet and the ACK  for
  849.         that octet.
  850.  
  851.     SRTT is the exponentially weighted round trip delay.
  852.  
  853.     UBND is the upper bound for data retransmission.
  854.  
  855.     LBND is the lower bound for data retransmission.
  856.  
  857.     RTO is the retransmission timeout for this data set.
  858.  
  859.  
  860. SRTT may be calculated from the following.
  861.  
  862.         SRTT = ( Beta * SRTT ) + ( ( 1 - Beta ) * RTT )
  863.  
  864. RTT and SRTT are initially set  to  an  estimated  delay  time.   The
  865. retransmission time out, RTO, may be calculated as follows:
  866.  
  867.         RTO = max ( LBND, min ( UBND, Alpha * SRTT ))
  868.  
  869.  
  870. By default, the lower bound, LBND, will be set to 1  second  and  the
  871. upper  bound,  UBND  will be set to 250 seconds.  These values may be
  872. changed with the .TCSLB and .TCSUB  functions  of  the  TCOPR%  JSYS.
  873. Beta must be in the range of 0.0 to 1.0.  It will initially be set to
  874. 0.9.  Alpha must be in the range of 0.0 to 250.0.  The default  value
  875. for  Alpha  is  1.5.   Although numbers less than 1.0 and larger than
  876. 10.0 are fairly useless, they are allowed.
  877.  
  878.  
  879. The system administrator may set the default upper and  lower  bounds
  880. on  retransmission.   This  may  be  done  with the .TCSDL and .TCSUL
  881. functions of the TCOPR% JSYS.
  882.    --------
  883.